package org.iteam.web.struts.service;

import java.util.List;
import java.util.Map;

/**
 * 高级服务类[带查询参数]
 * 
 * @author jacky
 * 
 * @param <T>
 */
public abstract class AdvancedParameterService<T> implements ModelService<T> {

	public abstract List<T> query() throws Exception;

	public abstract List<T> query(Map<String, Object> map) throws Exception;

	public abstract List<T> queryByPage(long page, long rows) throws Exception;

	public abstract List<T> queryByPage(long page, long rows,
			Map<String, Object> map) throws Exception;

	public abstract long count() throws Exception;

	public abstract long count(Map<String, Object> map) throws Exception;

	public abstract T show(String id) throws Exception;

	public abstract boolean create(T object);

	public abstract boolean update(T object);

	public abstract boolean delete(String id);

	public abstract boolean destroy(String id);

	// //////////////////////////////////////////默认实现
	public List<T> queryByParent(String parent) throws Exception {
		return null;
	}

	public List<T> queryByParent(String parent, Map<String, Object> map)
			throws Exception {
		return null;
	}

	public List<T> queryByPageAndParent(long page, long rows, String parent)
			throws Exception {
		return null;
	}

	public List<T> queryByPageAndParent(long page, long rows, String parent,
			Map<String, Object> map) throws Exception {
		return null;
	}

	public long countByParent(String parent) throws Exception {
		return 0;
	}

	public long countByParent(String parent, Map<String, Object> map)
			throws Exception {
		return 0;
	}

}
